package com.whl.sm.vo;

import com.whl.sm.model.assets.ComUnits;
import com.whl.sm.model.expense.ContractTenancy;
import com.whl.sm.model.expense.ExpenseType;
import com.whl.sm.model.system.OrgUserInfo;
import lombok.Data;

import java.util.Date;

@Data
public class OrgUserContractTenancyExpenseVo {

    public OrgUserContractTenancyExpenseVo(ContractTenancy contractTenancy, ComUnits comUnits,
                                           OrgUserInfo userInfo, ExpenseType expenseType
    ){
        if (contractTenancy != null){
            this.id = contractTenancy.getId();
            this.contractUrl = contractTenancy.getContractUrl();
            this.createTime = contractTenancy.getCreateTime();
            this.updateTime = contractTenancy.getUpdateTime();
            this.visible = contractTenancy.getVisible();
            this.validTime = contractTenancy.getValidTime();
        }

        if (comUnits != null){
            this.unitId = comUnits.getId();
            this.unitCode = comUnits.getUnitCode();
        }

        if (userInfo != null){
            this.userId = userInfo.getUserId();
            this.userName = userInfo.getUserName();
        }

        if (expenseType != null){
            this.expenseId = expenseType.getId();
            this.expenseName = expenseType.getExpenseName();
        }



    }


    private String id;

    private String unitId;

    private String unitCode;

    private String userId;

    private String userName;

    private String expenseId;

    private String expenseName;

    private Integer visible;

    private Date validTime;

    private String contractUrl;

    private Date createTime;

    private Date updateTime;
}
